/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 活动列表查询
 */
export function queryPage(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}
/**
 * 推荐/取消推荐
 */
export function updateRecommend(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupActivity/updateRecommendStatus',
    method: 'post',
    data
  })
}
/**
 * 启用/禁用
 */
export function updateStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupActivity/updateActivityStatus',
    method: 'post',
    data
  })
}

/**
 * 详情
 */
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/interestGroupActivity/get',
    method: 'post',
    data
  })
}
/**
 * 报名列表查询
 */
export function signQueryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/groupActivityRegistration/queryPage',
    method: 'post',
    data
  })
}

/**
 * 报名统计导出脱敏
 */
export function maskAPI4apply(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/groupActivityRegistration/activityRegistrationMaskingExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 报名统计导出不脱敏
 */
export function noMaskAPI4apply(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/groupActivityRegistration/activityRegistrationNoMaskingExport',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 签到记录
 */
export function signDetailQueryPage(data, t) {
  const url = t === '1' ? 'backend/activitySignInfo/noSignedQueryPageGroupActivity' : '/backend/activitySignInfo/signedQueryPageGroupActivity'
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}

/**
 * 签到统计导出脱敏
 */
export function maskAPI4sign(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activitySignInfo/signedExportMasking',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 签到统计导出不脱敏
 */
export function noMaskAPI4sign(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activitySignInfo/signedExportNoMasking',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 获取签到类型
 * @param data
 * @returns {*}
 */
export function getSignList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/solicitationStatistic',
    method: 'post',
    data
  })
}
